import java.io.*;
import java.net.*;
public class EchoServer {

	static ServerSocket soc = null;
	public static void main(String[] args) throws Exception {
		soc = new ServerSocket(20);
		System.out.println("Server Running");
		while(true){
			Socket client = soc.accept();
			System.out.println("Connecting from:" + client.getInetAddress());
			DataInputStream dis= new DataInputStream(client.getInputStream());
			String temp = dis.readUTF();
			
			DataOutputStream dos = new DataOutputStream(client.getOutputStream());
			dos.writeUTF(temp);
			dos.writeUTF(temp);
			dos.writeUTF(temp);
			dos.close();
			client.close();
		}


	}

}
